A Statically Safe Alternative to Virtual Types

نویسندگان

  • Kim B. Bruce
  • Martin Odersky
  • Philip Wadler
چکیده

Parametric types and virtual types have recently been proposed as extensions to Java to support genericity. In this paper we investigate the strengths and weaknesses of each. We suggest a variant of virtual types which has similar expressiveness, but supports safe static type checking. This results in a language in which both parametric types and virtual types are well-integrated, and which is statically type-safe.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Semantics-Driven Language Design: Statically Type-safe Virtual Types in Object-oriented Languages

The virtual class 15] construct was rst introduced in the language Beta to provide added expressiveness when used with inheritance. Unfortunately, the virtual class construct in Beta is not statically type-safe. In this paper we show how a generalization of the semantics of object-oriented languages with a MyType construct leads to a variant of virtual classes which needs no run-time checks. Th...

متن کامل

Unifying Genericity - Combining the Benefits of Virtual Types and Parameterized Classes

Generic types in programming languages are most often supported with various forms of parametric polymorphism, i.e. functions on types. Within the framework of object-oriented languages, virtual types present an alternative where specific types are derived from generic ones using inheritance rather than function application. While both mechanisms are statically safe and support basic genericity...

متن کامل

Open Types and Bidirectional Relationships as an Alternative to Classes and Inheritance

Open types are presented as a simple yet powerful data model for statically typed procedural and object-oriented programming languages, that overcomes the limitations of the traditional record-oriented model. The basic idea is to separate type definitions from the definitions of their attributes in order to allow incremental definitions of the latter. Furthermore, bidirectional relationships ar...

متن کامل

Safe Runtime Downcasts With Ownership Types

The possibility of aliasing between objects constitutes one of the primary challenges in understanding and reasoning about correctness of object-oriented programs. Ownership types provide a principled way of specifying statically enforcable restrictions on object aliasing. Ownership types have been used to aid program understanding and evolution, verify absence of data races and deadlocks in mu...

متن کامل

Optimizing Dynamic Class Composition in a Statically Typed Language

In statically typed languages the set of classes and similar classifiers is commonly fully determined at compile time. Complete classifier representations can then be loaded at run-time, e.g., from a an executable file or a class file. However, some typing constructs—such as virtual classes—enable a type safe treatment of classifiers and their associated types and instances, even in the case wh...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1998